package com.joshondesign.sdljava.events;


import com.joshondesign.sdljava.SDL_Event;
import com.joshondesign.sdljava.gfx.ButtonNode;
import com.joshondesign.sdljava.gfx.Callback;
import com.joshondesign.sdljava.gfx.Control;

public class RawEvents {
    
    public static abstract class RawEvent {
        public abstract Category getCategory();
    }
    
    public static class RawMouseEvent extends RawEvent {
        public int x, y, button;
        public boolean pressed, released;


        public int getX() {
            return this.x;
        }
        public int getY() {
            return this.y;
        }
        public int getButton() {
            return this.button;
        }
        public boolean isPressed() {
            return this.pressed;
        }
        public boolean isReleased() {
            return this.released;
        }

        @Override
        public Category getCategory() {
            return Category.Mouse;
        }
    }

    public static class RawControlEvent extends RawEvent {

        private Control target;

        public RawControlEvent(Control target) {
            this.target = target;
        }

        @Override
        public Category getCategory() {
            return Category.Control;
        }

        public Control getTarget() {
            return target;
        }
    }

    public static class RawKeyEvent extends RawEvent {
        public Keyboard.Keycode keyCode;
        public boolean shiftPressed;
        public boolean altPressed;
        public boolean controlPressed;
        public boolean commandPressed;
        public boolean pressed;
        public boolean released;

        public Keyboard.Keycode getKeyCode() {
            return keyCode;
        }

        @Override
        public Category getCategory() {
            return Category.Keyboard;
        }


        public boolean isPressed() {
            return pressed;
        }

        public boolean isReleased() {
            return released;
        }
    }
    
    public enum Category {
        Mouse, Keyboard, Accelerometer, Compass, Synthetic, Control, Multitouch
    }

}
